
#CFLAGS = -Wall -O0 -g  -std=gnu99
CFLAGS = -Wall -O3 -std=gnu99

test: main.c point.o main_matrix.o \
		physical_constants.o list.o mpi_tools.o matrix.o opencl_tools.o \
		fuel_cell_infos.o point.h physical_constants.h \
		fuel_cell_infos.h params.o export.o legend.o
	mpicc -lm ${CFLAGS} main.c main_matrix.o \
		list.o mpi_tools.o opencl_tools.o matrix.o fuel_cell_infos.o point.o \
		physical_constants.o params.o export.o legend.o -o test -l OpenCL

legend.o: legend.c legend.h
	mpicc -c ${CFLAGS} legend.c

list.o: list.c list.h
	mpicc -c ${CFLAGS} list.c

mpi_tools.o: mpi_tools.c mpi_tools.h
	mpicc -c ${CFLAGS} mpi_tools.c

matrix.o: matrix.c matrix.h
	mpicc -c ${CFLAGS} matrix.c

main_matrix.o: main_matrix.c main_matrix.h
	mpicc -c ${CFLAGS} main_matrix.c

fuel_cell_infos.o: fuel_cell_infos.c fuel_cell_infos.h
	mpicc -c ${CFLAGS} fuel_cell_infos.c

point.o: point.c point.h
	mpicc -c ${CFLAGS} point.c

physical_constants.o: physical_constants.c physical_constants.h
	mpicc -c ${CFLAGS} physical_constants.c

params.o: params.c params.h
	mpicc -c ${CFLAGS} params.c

export.o: export.c export.h
	mpicc -c ${CFLAGS} export.c
	
opencl_tools.o: opencl_tools.c opencl_tools.h
	mpicc -c ${CFLAGS} opencl_tools.c
clean:
	rm *.o test
